home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / filesyst / thsfs.tgz / thsfs.tar / thsfs / modul.c < prev    next >
C/C++ Source or Header  |  1994-10-04  |  2KB  |  68 lines

  1. /*************************************************************
  2.  *                                                           *
  3.  *    ths  Filesystem                  04.10.94      V1.1    *
  4.  *                                                           *
  5.  *    Thomas Scheuermann     ths@ai-lab.fh-furtwangen.de     *
  6.  *                                                           *
  7.  *************************************************************/
  8.  
  9. #include <linux/kernel.h>
  10. #include <linux/module.h>
  11. #include <linux/sched.h>
  12. #include <linux/errno.h>
  13. #include <linux/string.h>
  14. #include <linux/stat.h>
  15. #include <linux/mm.h>
  16. #include <linux/locks.h>
  17. #include <linux/fs.h>
  18. #include <linux/malloc.h>
  19.  
  20. #include <asm/system.h>
  21. #include <asm/segment.h>
  22. #include <asm/bitops.h>
  23.  
  24. #include "ths.h"
  25. #include "ths_i.h"
  26. #include "version.h"
  27.  
  28. extern int printk( const char* fmt, ...);
  29.  
  30. /*
  31.  * Struktur fuer die Uebergabe an den Kern zur
  32.  * Registrierung des Filesystems
  33.  */
  34.  
  35. static struct file_system_type ths_type = {
  36.         ths_read_super,
  37.         "ths",
  38.         1
  39. };
  40.  
  41. /*
  42.  * Funktion zum Einbinden des Moduls in den Kern
  43.  */
  44.  
  45. int init_module(void)
  46. {       int res;
  47.  
  48.         res = register_filesystem(&ths_type);
  49.         return res;
  50. }
  51.  
  52. /*
  53.  * Funktion zum Loeschen des Moduls aus dem Kern
  54.  */
  55.  
  56. void cleanup_module(void)
  57. {       int res;
  58.  
  59.         if (MOD_IN_USE)
  60.                 printk("ths: filesystem in use, removal delayed\n");
  61.  
  62.         res = unregister_filesystem(&ths_type);
  63.         if (res < 0) {
  64.                 printk("ths: cannot unregister file system type\n");
  65.         }
  66. }
  67.  
  68.